package streamproc.filtercomponents;

import streamdef.DEFINES.FieldRelationType;
import event.DEFINES.CEPLEventDataFieldType;

public class FilterStatement {
	public FilterStatement() {
		streamID = -1;
		field = null;
		valueType = CEPLEventDataFieldType.UNKNOWN;
		wildCard = false;
		relationType = FieldRelationType.UNKNOWN;
		wasInOr = false;

		charValue = 0;
		shortValue = 0;
		intValue2 = 0;
		longValue = 0;
		floatValue = 0;
		doubleValue = 0;
		charValue2 = 0;
		shortValue2 = 0;
		intValue2 = 0;
		longValue2 = 0;
		floatValue2 = 0;
		doubleValue2 = 0;
		stringValue = null;
	}

	public FilterStatement clone() {
		FilterStatement newFS = new FilterStatement();
		newFS.charValue = this.charValue;
		newFS.charValue2 = this.charValue2;
		newFS.shortValue = this.shortValue;
		newFS.shortValue2 = this.shortValue2;
		newFS.intValue = this.intValue;
		newFS.intValue2 = this.intValue2;
		newFS.longValue = this.longValue;
		newFS.longValue2 = this.longValue2;
		newFS.floatValue = this.floatValue;
		newFS.floatValue2 = this.floatValue2;
		newFS.doubleValue = this.doubleValue;
		newFS.doubleValue2 = this.doubleValue2;
		newFS.stringValue = this.stringValue;

		newFS.streamID = this.streamID;
		newFS.field = new String(this.field);
		newFS.valueType = this.valueType;
		newFS.relationType = this.relationType;
		newFS.wildCard = this.wildCard;
		newFS.wasInOr = this.wasInOr;

		return newFS;
	}

	long streamID;
	String field;
	CEPLEventDataFieldType valueType;
	boolean wildCard; // anyValueIsAllowed
	boolean wasInOr;

	// reduce amount of checkcasts by storing separate values for each type
	char charValue;
	short shortValue;
	int intValue;
	long longValue;
	float floatValue;
	double doubleValue;
	String stringValue;

	FieldRelationType relationType;

	char charValue2;
	short shortValue2;
	int intValue2;
	long longValue2;
	float floatValue2;
	double doubleValue2;
}